package com.sys.servlet;

import com.sys.dao.sysDao;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "getWarehouseServlet", urlPatterns = "/sys/getWarehouse", description = "获取仓库列表")
public class getWarehouseServlet extends sysServlet {
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    setHeadHtml(req, resp, "getWarehouseServlet");
    sysDao dao = new sysDao();
    PrintWriter out = resp.getWriter();
    int warehouseType = 9999;
    try {
      warehouseType = Integer.valueOf(req.getParameter("warehouseType"));
    } catch (Exception ignored) {}

    dao.getWarehouse(warehouseType, out::print);
  }
}
